package com.wocai.jrt.orgadmin.utils;

import com.vteba.security.SecurityContextUtils;
import com.vteba.security.publisher.security.utils.PublisherSecurityContextUtils;
import com.wocai.jrt.orgadmin.employee.model.Employee;
import com.wocai.jrt.orgadmin.issuers.model.Issuers;

public class UserUtils {
	public static Employee getUser() {
		return (Employee) SecurityContextUtils.getCurrentUserInfo();
	}
	
	public static Issuers getPublisher() {
		return (Issuers) PublisherSecurityContextUtils.getCurrentUserInfo();
	}
	
	public static String getUserId() {
		return getUser().getId();
	}
	
	public static String getIssuersId() {
		return getPublisher().getId();
	}
	
	public static String getOrgCode() {
		return getUser().getOrgCode();
	}
	
	public static String getIssuersOrgCode() {
		return getPublisher().getOrgCode();
	}
	
	public static String getOrgId() {
		return getUser().getTenantId();
	}
	
	public static String getIssuersOrgId() {
		return getPublisher().getTenantId();
	}
}
